package com.example.mobile2021606159yhf0415;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
    private RecyclerView rvMainPeople;
    private String[] names = {"丁云生","方华高","朱云贵","周辉","杨文","朱元元","周正文","张伟"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        rvMainPeople.setLayoutManager(new LinearLayoutManager(this));
        PeopleAdapter adapter=new PeopleAdapter(names);
        rvMainPeople.setAdapter(adapter);
    }
    private void initView(){
        rvMainPeople = (RecyclerView) findViewById(R.id.rv_Main_people);
    }
}